package vip;

import java.util.Scanner;

public class TestVip {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		VipManager vm = new VipManager();

		while (true) {
			System.out.println("1:加新客户\n2：查看所有\n3:查找积分：\n9:退出！");
			int ch = sc.nextInt();
			switch (ch) {
			case 1:
				Vip v = new Vip();// 临时使用
				System.out.println("请输入客户编号和积分：");
				v.cardNo = sc.next();
				v.score = sc.nextInt();
				vm.add(v);
				break;
			case 2:
				vm.printCust();
				break;
			case 3:
				System.out.println("请输入卡号：");
				String c = sc.next();
				Vip card = vm.search(c);
				if (card == null) {
					System.out.println("查无此人");
				} else {
					System.out.println("此人的积分是" + card.score);
				}
				break;
			case 9:
				return;
			}
		}
	}

}
